package view;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;

import view.game.Board;
import controller.Presenter;

public class Menu implements View {
	Board bord;
	Display display;
	Shell shell;
	
	private void initComponents() {
		display = new Display();
		shell = new Shell(display);
		shell.setLayout(new org.eclipse.swt.layout.GridLayout(2, false));
		shell.setSize(500, 500);
		shell.setText("Menu");
		shell.setTextDirection(SWT.RIGHT_TO_LEFT);
		shell.setText("File");
		shell.setTextDirection(SWT.LEFT);
		shell.setText("Edit");
		shell.setTextDirection(SWT.LEFT);
		
		Label label1 = new Label(shell, SWT.BORDER);
		label1.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
		
		Board board = new Board(shell, SWT.BORDER);
		board.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2));
		
		Button button1 = new Button(shell, SWT.PUSH);
		button1.setText("Undo Move");
		button1.setLayoutData(new GridData(SWT.TOP, SWT.TOP, false, false, 1, 1));
		
		Button button2 = new Button(shell, SWT.PUSH);
		button2.setText("Restart Game");
		button2.setLayoutData(new GridData(SWT.TOP, SWT.TOP, false, false, 2, 1));
		
		Button button3 = new Button(shell, SWT.PUSH);
		button3.setText("Load Game");
		button3.setLayoutData(new GridData(SWT.TOP, SWT.TOP, false, false, 2, 1));

		Button button4 = new Button(shell, SWT.PUSH);
		button4.setText("Save Game");
		button4.setLayoutData(new GridData(SWT.TOP, SWT.TOP, false, false, 2, 1));
		
		shell.open();
	}

	public void run() {
		initComponents();
		while(!shell.isDisposed()) {
			if(!display.readAndDispatch()) {
				display.sleep();
			}
		}
			
		display.dispose();
	}

	@Override
	public void displayData(int[][] data) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public int getUserCommand() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void addObserver(Presenter p) {
		// TODO Auto-generated method stub
		
	}
}
